{{ partial "header.html" . }}
<section class="main">
    <div class="container">
        <div class="content">
            {{ if .Content }}
                <div class="markdown">
                    {{ .Content }}
                </div>
            {{ end }}
            <div class="page-heading">{{ i18n "blogHeading" }}</div>
            <ul>
                {{ if eq .Site.Params.bloggroupby "month" }}
                    {{ $.Scratch.Set "datespec" "Jan, 2006" }}
                {{ else if eq .Site.Params.bloggroupby "year" }}
                    {{ $.Scratch.Set "datespec" "2006" }}
                {{ end }}
                {{ if not ($.Scratch.Get "datespec") }}
                    {{ range .Data.Pages.ByPublishDate.Reverse }}
                    {{ partial "li.html" . }}
                    {{ end }}
                {{ else }}
                    {{ range .Data.Pages.ByPublishDate.GroupByDate ($.Scratch.Get "datespec") "desc" }}
                        <li class="post-item no-bullet">
                            <span class="date">{{ .Key }}</span>
                        </li>
                        {{ range .Pages.ByPublishDate.Reverse }}
                            {{ partial "li.html" . }}
                        {{ end }}
                    {{ end }}
                {{ end }}
            </ul>
        </div>
    </div>
</section>
{{ partial "footer.html" . }}

